<label><input type="checkbox" name="all" class="parent" />Check All</label>
<hr>
<label><input type="checkbox" name="hobbies[]" class="child" />Cricket</label><br>
<label><input type="checkbox" name="hobbies[]" class="child" />Football</label><br>
<label><input type="checkbox" name="hobbies[]" class="child" />Tennis</label><br>
<label><input type="checkbox" name="hobbies[]" class="child" />Chess</label><br>

<script src="jquery-1.10.2.js" type="text/javascript"></script>
<script type="text/javascript">
  $(document).ready(function(){
    $('.parent').on('click',function(){

      var flag = $(this).is(':checked');
//alert(flag)

      $('input[type="checkbox"].child')
      .prop('checked',flag);

    })
  });
</script>
